package cn.pilipa.common.config.data;

import cn.pilipa.common.config.MongoConfigTest;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDate;
import java.time.YearMonth;
import org.javamoney.moneta.Money;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection = MongoConfigTest.COLLECTION_NAME)
public class ObjHolder {
  @Id
  private String name;
  private Money money;

  @JsonFormat(shape = JsonFormat.Shape.STRING)
  private LocalDate localDate;
  @JsonFormat(shape = JsonFormat.Shape.STRING)
  private YearMonth yearMonth;

  public ObjHolder() {
  }

  /**
   * JSON测试类.
   */
  public ObjHolder(String name, Money money, LocalDate localDate, YearMonth yearMonth) {
    this.name = name;
    this.money = money;
    this.localDate = localDate;
    this.yearMonth = yearMonth;
  }

  public String getName() {
    return name;
  }

  public Money getMoney() {
    return this.money;
  }

  public LocalDate getLocalDate() {
    return localDate;
  }

  public YearMonth getYearMonth() {
    return yearMonth;
  }
}
